<template>
    <view>
        <view style="height: 88px"></view>

        <!-- 列表 -->
        <view class="news">
            <view class="newslist" v-for="(item, index) in notelist" :key="index">
                <view class="title" @tap="toWorkerDetail" :data-id="item.id">
                    <view class="detail">
                        <view class="info">
                            <view>{{ item.name }}</view>
                            <view>{{ item.sex == 1 ? '男' : '女' }} / {{ item.age }}岁 / {{ item.education }} / {{ item.express }}</view>
                            <view class="jobmoney">
                                意向职位:
                                <text>{{ item.jobtitle }}</text>
                            </view>
                        </view>

                        <view class="pic">
                            <image :src="item.avatarUrl"></image>

                            <text class="time">{{ item.refreshtime }}</text>

                            <image :src="'../../imgs/icon/' + (item.sex == 1 ? 'man' : 'sex') + '.png'" class="footimg" style="width: 30rpx; height: 30rpx"></image>
                        </view>
                    </view>
                </view>
            </view>
        </view>
    </view>
</template>

<script>
import { Note } from '../findworker/note-model.js';
var note = new Note();
export default {
    data() {
        return {
            notelist: ''
        };
    }
    /**
     * 生命周期函数--监听页面加载
     */,
    onLoad: function (options) {
        var that = this;
        uni.setNavigationBarTitle({
            title: '我的人才库'
        });
        var params = {};
        note.getAgentNoteListData((data) => {
            console.log(data);
            that.setData({
                notelist: data.notelist
            });
        }, params);
    },
    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function () {},
    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {},
    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function () {},
    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function () {},
    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function () {},
    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function () {},
    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function () {},
    methods: {
        toWorkerDetail: function (e) {
            var id = e.currentTarget.dataset.id;
            uni.navigateTo({
                url: '/pages/workerdetail/index?id=' + id
            });
        }
    }
};
</script>
<style>
/* pages/agentnotelist/index.wxss */
.news {
    margin-top: 10rpx;
    width: 100%;
    display: flex;
    flex-direction: column;
}
.news .newstitle {
    width: 100%;
    height: 80rpx;
    line-height: 80rpx;
    margin-left: 20rpx;
    font-size: 0.7rem;
    border-bottom: 1rpx solid #efefef;
    margin: 0 auto;
    display: flex;
    flex-direction: row;
    align-content: center;
}

.news .newstitle view:nth-child(1) {
    height: 40rpx;
    line-height: 40rpx;
    width: 6rpx;
    background: #3274e5;
    align-self: center;
    margin-left: 10rpx;
}
.news .newstitle view:nth-child(2) {
    height: 80rpx;
    line-height: 80rpx;
    width: 150rpx;
    padding-left: 15rpx;
}

.news .newslist {
    display: flex;
    flex-direction: row;
    width: 720rpx;
    margin: 0 auto;
    padding: 20rpx;
    margin-bottom: 20rpx;
    background: #fff;
}

.news .newslist .title {
    width: 100%;
    flex-direction: column;
    display: flex;
    justify-content: space-between;
}

.news .newslist .title .detail {
    padding-left: 2%;
    text-align: left;
    font-size: 0.8rem;
    color: #000;
    display: flex;
    flex-direction: row;
    width: 100%;
}

.news .newslist .title .detail .pic {
    width: 20%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.news .newslist .title .detail .pic image {
    width: 120rpx;
    height: 120rpx;
    align-self: center;
    border-radius: 60rpx;
}
.news .newslist .title .detail .pic text {
    font-size: 10px;
    color: #646464;
}

.footimg {
    width: 40rpx;
    height: 40rpx;
    position: absolute;
    left: 120rpx;
    right: 0;
    top: 80rpx;
}

.news .newslist .title .detail .info {
    width: 75%;
}

.news .newslist .title .detail .info view:nth-child(1) {
    padding-top: 10rpx;
    color: #000;
    font-weight: bold;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    font-size: 15px;
}

.news .newslist .title .detail .info view:nth-child(2) {
    padding-top: 10rpx;
    padding-bottom: 10rpx;
    color: #646464;
    font-size: 12px;
}

.news .newslist .title .detail view:nth-child(3) {
    padding-top: 10rpx;
    padding-right: 10rpx;
}
.news .newslist .title .price {
    width: 28%;
}

.news .newslist .title .price .money {
    color: #d65408;
    font-weight: bold;
    font-size: 0.7rem;
    padding-right: 10rpx;
}

.jobname > text {
    color: #b7b7b7;
}
.jobmoney {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    color: #646464;
    font-size: 13px;
}

.jobmoney text {
    color: #1296db;
    margin-left: 10rpx;
}
.info .time {
    color: #ff4129;
    font-size: 0.7rem;
}
</style>
